<?php

$url = "http://fly.layui.com/auth/code";

// $appcode = "ab7bfa4f7d544241998ea5d8a8ddb028";

// $headers = array();

// array_push($headers, "Authorization:APPCODE " . $appcode);

$post_data  = ['phone'=>'18925139194'];

$data_string = json_encode($post_data);
  

$curl = curl_init();

curl_setopt($curl, CURLOPT_POST, 1);

curl_setopt($curl, CURLOPT_URL, $url);

curl_setopt($curl, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'Content-Length: ' . strlen($data_string)
));

// curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);

curl_setopt($curl, CURLOPT_POSTFIELDS,$data_string);

curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

curl_setopt($curl, CURLOPT_HEADER, false);


$data= curl_exec($curl);

var_dump($data);exit;

// echo($data);

var_dump(json_decode($data,true));